
def use_name(val):
    print("name id :%s" % (id(val)))
    val = "hanshu1"
    print("name id modified :%s" % (id(val)))

def test_ref():
    name = "hanshu" 
    print("name id :%s" % (id(name)))
    use_name(name)

class MyItem:
    def __init__(self, val):
        self._data = val


def modify_my_item(my_item):
    my_item._data = 4
    print("my_item id:{}".format(id(my_item)))

def test_my_item():
    my_item = MyItem(3)
    print("my_item._data = {}".format(my_item._data))
    print("my_item id:{}".format(id(my_item)))
    modify_my_item(my_item)
    print("my_item id:{}".format(id(my_item)))
    print("my_item._data = {}".format(my_item._data))

test_ref()

test_my_item()
